/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.eclass.servlet.front;

import cn.eclass.servlet.ActionFace;
import cn.eclass.utils.UserSessionInfo;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;

/**
 *
 * @author fortruth
 */
public class Ujifen extends ActionFace {

	private void checkLogIn() throws ServletException, IOException {
		if(user != null) return;

		request.setAttribute("redirect", "ujifen");
		request.getRequestDispatcher(logInView).forward(request, response);
	}
	
    @Override
    public void doIndex() {
        try {
        	checkLogIn();
        	UserSessionInfo usi = new UserSessionInfo(user, session);
        	usi.setGiftOrderList();
        	usi.setSchoolOrderList();
        	
            request.getRequestDispatcher(view).forward(request, response);
        } catch (ServletException ex) {
            Logger.getLogger(Ujifen.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Ujifen.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
